/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.model;

import java.util.ArrayList;
import java.util.List;
import javax.swing.table.AbstractTableModel;

public class tabel_member extends AbstractTableModel {

    private List<Member> list = new ArrayList<Member>();

    public tabel_member(List<Member> array) {
        this.list = array;
    }

    @Override
    public int getRowCount() {
        return list.size();
    }

    @Override
    public int getColumnCount() {
        return 4;
    }

    @Override
    public Object getValueAt(int rowIndex, int columnIndex) {
        Member m = list.get(rowIndex);
        switch (columnIndex) {
            case 0:
                return m.getId();
            case 1:
                return m.getNama();
            case 2:
                return m.getAlamat();
            case 3:
                return m.getNo_telp();
            default:
                ;
                return "";
        }
    }

    public String kolom(int column) {
        switch (column) {
            case 0:
                return "Id";
            case 1:
                return "Nama";
            case 2:
                return "Alamat";
            case 3:
                return "No_telp";
            default:
                ;
                return "";
        }

    }
}
